//
//  MCURLImageView.m
//  ZITHER
//
//  Created by imac on 2018/6/7.
//  Copyright © 2018年 MinesTime. All rights reserved.
//

#import "MCURLImageView.h"


@implementation MCURLImageView
- (void)setImageWithURLStr:(NSString *)url placeholderImageType:(ImageViewPlaceholderType)type {
    UIImage *placeholderImage = nil;
    switch (type) {
        case ImageViewPlaceholderTypeUserIcon: {
            placeholderImage = kUSER_ICON_IMAGE;
        } break;
        case ImageViewPlaceholderTypeGoods: {
            placeholderImage = kSQUARE_PLACEHOLDER_IMAGE;
        } break;
        case ImageViewPlaceholderTypeNone: {
            placeholderImage = nil;
        } break;
        default:
            break;
    }

    
    [self sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:placeholderImage];

    
//     [self yy_setImageWithURL:[NSURL URLWithString:url] placeholder:placeholderImage options:(YYWebImageOptionSetImageWithFadeAnimation) completion:nil];
}
- (void)setImageWithURLStr:(NSString *)url placeholder:(UIImage *)image {
//    [self yy_setImageWithURL:[NSURL URLWithString:url] placeholder:image options:(YYWebImageOptionSetImageWithFadeAnimation) completion:nil];
    
    [self sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:image];

}
@end
